#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM lsqtzj/openeuler_dotnet_sdk AS base
EXPOSE 5000

FROM lsqtzj/openeuler_dotnet_sdk AS build
WORKDIR /src
COPY ["RuYiAdmin.Net.WebApi/RuYiAdmin.Net.WebApi.csproj", "RuYiAdmin.Net.WebApi/"]
COPY ["RuYiAdmin.Net.Entity/RuYiAdmin.Net.Entity.csproj", "RuYiAdmin.Net.Entity/"]
COPY ["RuYiAdmin.Net.Common/RuYiAdmin.Net.Common.csproj", "RuYiAdmin.Net.Common/"]
COPY ["RuYiAdmin.Net.Repository/RuYiAdmin.Net.Repository.csproj", "RuYiAdmin.Net.Repository/"]
COPY ["RuYiAdmin.Net.Service/RuYiAdmin.Net.Service.csproj", "RuYiAdmin.Net.Service/"]
COPY ["SqlSugar/Src/Asp.NetCore2/SqlSugar/SqlSugar.csproj", "SqlSugar/Src/Asp.NetCore2/SqlSugar/"]
RUN dotnet restore "RuYiAdmin.Net.WebApi/RuYiAdmin.Net.WebApi.csproj"
COPY . .
WORKDIR "/src/RuYiAdmin.Net.WebApi"
RUN dotnet build "RuYiAdmin.Net.WebApi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "RuYiAdmin.Net.WebApi.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
#RUN yum -y install libgdiplus libgdiplus-devel
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "RuYiAdmin.Net.WebApi.dll"]